/* 基础样式 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #111827;
    color: white;
}

.game-title {
    background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* 游戏画布样式 */
#game-canvas {
    background-color: #1f2937;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
}

/* 按钮样式 */
.game-btn {
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.5);
}

.game-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.5);
}

/* 设置按钮样式 */
.setting-btn {
    background-color: #374151;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.setting-btn:hover {
    background-color: #4b5563;
}

.setting-btn.selected {
    background-color: #4f46e5;
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.6);
}

.setting-group {
    margin-bottom: 16px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4f46e5;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 主题和皮肤选择样式 */
.theme-option, .skin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.theme-option:hover, .skin-option:hover {
    background-color: #374151;
}

.theme-option.selected, .skin-option.selected {
    background-color: #4f46e5;
}

.theme-preview, .skin-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #4b5563;
    overflow: hidden;
    position: relative;
}

/* 主题预览样式 */
.classic-theme {
    background-color: #1f2937;
}

.classic-theme:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #4f46e5;
    border-radius: 4px;
    top: 40px;
    left: 40px;
}

.classic-theme:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    top: 20px;
    left: 70px;
}

.space-theme {
    background-color: #0f172a;
    background-image: radial-gradient(white, rgba(255, 255, 255, 0.2) 2px, transparent 2px);
    background-size: 30px 30px;
}

.space-theme:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #22d3ee;
    border-radius: 4px;
    top: 40px;
    left: 40px;
    box-shadow: 0 0 10px #22d3ee;
}

.space-theme:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f97316;
    border-radius: 50%;
    top: 20px;
    left: 70px;
    box-shadow: 0 0 8px #f97316;
}

.underwater-theme {
    background-color: #0c4a6e;
    background-image: linear-gradient(0deg, rgba(12, 74, 110, 0.8) 0%, rgba(12, 74, 110, 0.4) 100%);
}

.underwater-theme:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #06b6d4;
    border-radius: 4px;
    top: 40px;
    left: 40px;
}

.underwater-theme:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fbbf24;
    border-radius: 50%;
    top: 20px;
    left: 70px;
}

.pixel-theme {
    background-color: #18181b;
    background-image: linear-gradient(#27272a 1px, transparent 1px),
                      linear-gradient(90deg, #27272a 1px, transparent 1px);
    background-size: 10px 10px;
}

.pixel-theme:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #84cc16;
    top: 40px;
    left: 40px;
}

.pixel-theme:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fb7185;
    top: 20px;
    left: 70px;
}

/* 蛇皮肤预览样式 */
.default-skin {
    background-color: #1f2937;
}

.default-skin:before {
    content: "";
    position: absolute;
    width: 60px;
    height: 20px;
    background-color: #4f46e5;
    border-radius: 4px;
    top: 40px;
    left: 20px;
}

.neon-skin {
    background-color: #1f2937;
}

.neon-skin:before {
    content: "";
    position: absolute;
    width: 60px;
    height: 20px;
    background-color: #22d3ee;
    border-radius: 4px;
    top: 40px;
    left: 20px;
    box-shadow: 0 0 10px #22d3ee;
}

.rainbow-skin {
    background-color: #1f2937;
}

.rainbow-skin:before {
    content: "";
    position: absolute;
    width: 60px;
    height: 20px;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6);
    border-radius: 4px;
    top: 40px;
    left: 20px;
}

.metal-skin {
    background-color: #1f2937;
}

.metal-skin:before {
    content: "";
    position: absolute;
    width: 60px;
    height: 20px;
    background: linear-gradient(90deg, #94a3b8, #cbd5e1, #94a3b8);
    border-radius: 4px;
    top: 40px;
    left: 20px;
}

/* 虚拟控制按钮样式 */
.virtual-btn {
    width: 60px;
    height: 60px;
    background-color: rgba(79, 70, 229, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.virtual-btn:active {
    background-color: rgba(79, 70, 229, 0.9);
    transform: scale(0.95);
}

/* 响应式样式 */
@media (max-width: 640px) {
    #game-canvas {
        width: 100%;
        height: auto;
    }
    
    #virtual-controls {
        display: grid;
    }
    
    .theme-preview, .skin-preview {
        width: 80px;
        height: 80px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* 食物类型样式 */
.food-normal {
    background-color: #ef4444;
    border-radius: 50%;
}

.food-bonus {
    background-color: #f59e0b;
    border-radius: 50%;
}

.food-shrink {
    background-color: #10b981;
    border-radius: 50%;
}

/* 障碍物样式 */
.obstacle {
    background-color: #6b7280;
    border-radius: 2px;
}